<template>
  <div>
    <!-- 1.定义路由链接 -->
    <div id="nav">
      <router-link to="/home">首页</router-link>
      <router-link to="/mine">我的</router-link>
      <!--<router-link to="/user/001">用户</router-link>-->
      <router-link :to="'/user/' + userId" >用户</router-link>
    </div>
    <!-- 2.定义路由的占位符 -->
    <router-view></router-view>
  </div>
</template>


<script>
import {ref} from 'vue'
  export default  {
    setup(){
      // 服务端获取newsId为001
      const userId = ref('001');

      return {
        userId
      }
    }

  }
</script>


<style scoped>

</style>
